<template>
  <div class="event-wrap">
    <div class="crumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>
          <i class="el-icon-fa fa-edit"></i> 团员项目
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>

    <div class="container">
      <div class="table">
        <el-table :data="tableData" stripe>
          <el-table-column label="项目Id" prop="memberEventId" />
          <el-table-column label="项目名" prop="eventName" />
          <el-table-column label="团长" prop="leaderName" />
          <el-table-column label="推荐指数" prop="rate" />
          <el-table-column label="标价" prop="bidPrice" />
          <el-table-column label="应付" prop="shouldPrice" />
          <el-table-column label="实付" prop="budget" />
          <el-table-column align="center" label="操作" width="200px">
            <template slot-scope="scope">
              <el-button
                @click="deleteItem(scope.row.memberEventId)"
                size="mini"
                type="danger"
                >退选
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
import * as api from "../../api/member/event";

export default {
  name: "memberEvent",
  data() {
    return {
      tableData: []
    };
  },
  methods: {
    getList() {
      api.list().then(res => {
        this.tableData = res;
      });
    },
    deleteItem(memberEventId) {
      api.deleteItem(memberEventId).then(() => {
        this.$message.success("退选成功!");
        this.getList();
      });
    }
  },
  created() {
    this.getList();
  }
};
</script>

<style scoped></style>
